# import requests
# from tools.function import write_xlsx
#
# url = "https://www.goat.com/api/v1/products?filter=goat_storage&page=1"
#
# payload = {}
# headers = {
#     'Authorization': 'Token token="t5udyTQtwsmerZCwyu8K"',
#     'Cookie': '__cf_bm=Q9YKwd0nFzk03e1Mr33OLQRbszvPAcgiky6AFTXeWHQ-1717143949-1.0.1.1-75Ac7.LKP9BENb0NXvhSKDy.pSXpL3rEuCSrWb349jS4jGrxboIffSqs8wcuJQQkmSOTAXBS25FMBqv9fOTDog; _sneakers_session=r77CLbnKVLsfCPEg8AiFfalGgZUxfZT9YhL%2B%2FQqeiHoy7Y5f%2BUUije5cVUUO%2BxjYzgnE8xZ37RIMwmU5UTOi4XcRLhKerNzYZHoBH7Rwk%2FrWezPKxAPzyOlXoyMp20R3zP96yxOvpL8w3pUT9GY2CPOFHjRfAjKX0m0Wu3h48CfFCqNRKX0shqVySKr56SXXx42eySdc485kQb2htAnG%2BW57j8cDe7G5cifYLhLLexIpOPNUxdTKVGd0OcaVOM86Bxjgv%2FZxbnIJIHtIhgM%2FEuf8JbIuFGvEDPEOVKJw%2FxM%2B--sPVNcFMIImCZHQ6k--JDtPWx2wMVNwBsMU8uiofA%3D%3D'
# }
#
# s = 1
# li = []
# response = requests.request("GET", url, headers=headers, data=payload).json()
# z = response['products']
# for i in response['products']:
#     li.append([i['productTemplate']['sku'], i['size'], i['quantity']])
# while z != []:
#     s += 1
#     url1 = f"https://www.goat.com/api/v1/products?filter=goat_storage&page={s}"
#     res = requests.request("GET", url1, headers=headers, data=payload).json()
#     z = res['products']
#     for i in res['products']:
#         li.append([i['productTemplate']['sku'], i['size'], i['quantity']])
#
#
# write_xlsx(['货号','尺码','数量'], li, 'goat导出寄存库存')